<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">

    <h:form id="formTiposOperacoesNegociais" >

        <p:panel header="TIPOS DE OPERAÇÕES NEGOCIAIS" >

            <br/>

            <p:commandButton icon="ui-icon-plus"   
                             value="Novo" 
                             actionListener="#{tipoOperacaoNegocialBean.prepareCreate}" 
                             update=":formTipoOperacaoNegocial"
                             oncomplete="dialogTipoOperacaoNegocial.show()"
                             />

            <br/><br/>

            <p:dataTable id="dtTiposOperacoesNegociais"
                         var="item" 
                         value="#{tipoOperacaoNegocialBean.items}" 
                         emptyMessage="Não há tipos de operações negociais cadastradas" 
                         rowKey="#{item.id}" 
                         paginator="true" 
                         rows="10"  
                         rowsPerPageTemplate="5,10,15,20,25,30,35,40,45,50">

                <p:column headerText="Nome/Descrição" > 

                    <h:outputText value="#{item.descricao}" />

                </p:column>  

                
                <p:column headerText="Opções" 
                          style="width: 80px; text-align: center "> 

                    <p:commandButton icon="ui-icon-pencil"   
                                     title="editar tipoOperacaoNegocial" 
                                     update=":formTipoOperacaoNegocial"
                                     oncomplete="dialogTipoOperacaoNegocial.show()" > 

                        <f:setPropertyActionListener target="#{tipoOperacaoNegocialBean.selected}"
                                                     value="#{item}" />

                    </p:commandButton>

                    <p:commandButton icon="ui-icon-close"   
                                     title="excluir tipoOperacaoNegocial" 
                                     update=":formExclusaoTipoOperacaoNegocial"
                                     oncomplete="exclusaoTipoOperacaoNegocial.show()"> 

                        <f:setPropertyActionListener target="#{tipoOperacaoNegocialBean.selected}"
                                                     value="#{item}" />

                    </p:commandButton>

                </p:column>

            </p:dataTable>

        </p:panel>

    </h:form>

</ui:composition>

